package com.bdqn.entity;

import java.io.Serializable;
import java.util.Date;

/**
 * 员工实体类
 */
public class Emp implements Serializable {


    private Integer id;
    private String name;
    private String nickName;
    private Double sal;
    private Date born;
    private Integer deptId;
    private Dept dept;


    public Emp() {
    }

    public Emp(Integer id, String name, String nickName, Double sal, Date born, Integer deptId) {
        this.id = id;
        this.name = name;
        this.nickName = nickName;
        this.sal = sal;
        this.born = born;
        this.deptId = deptId;
    }

    public Emp(Integer id, String name, String nickName, Double sal, Date born, Dept dept) {
        this.id = id;
        this.name = name;
        this.nickName = nickName;
        this.sal = sal;
        this.born = born;
        this.dept = dept;
    }

    public Dept getDept() {
        return dept;
    }

    public void setDept(Dept dept) {
        this.dept = dept;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public Double getSal() {
        return sal;
    }

    public void setSal(Double sal) {
        this.sal = sal;
    }

    public Date getBorn() {
        return born;
    }

    public void setBorn(Date born) {
        this.born = born;
    }

    public Integer getDeptId() {
        if (dept != null) {
            return dept.getId();
        }
        return deptId;
    }

    public void setDeptId(Integer deptId) {
        this.deptId = deptId;
    }
}
